Differential influence of habit components on problematic behaviors - Revision 1

Author

Lavinia Wuensch, Yoann Stussi, Théo Vernede, Eva R. Pool

Published

May 20, 2025

Setup

Environment

Testing specific hypotheses with regression

Additional hierarchical multiple regressions conducted to address Reviewer 2’s comments. This analysis was presented in the rebuttal but is not present in the article.

Experiment 1

Media

# Model without habit
model_exp1_media <- lm(Media ~ Impuls. + Stress + Eat + Comp., data = experiment_1_factors)
summary(model_exp1_media)

Call:
lm(formula = Media ~ Impuls. + Stress + Eat + Comp., data = experiment_1_factors)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.34509 -0.60489 -0.04435  0.58343  2.53391 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  0.00560    0.04751   0.118  0.90623    
Impuls.      0.13928    0.04915   2.834  0.00486 ** 
Stress       0.34353    0.05582   6.154 2.02e-09 ***
Eat         -0.11357    0.05248  -2.164  0.03112 *  
Comp.        0.13364    0.05342   2.502  0.01280 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.9062 on 359 degrees of freedom
  (17 observations deleted due to missingness)
Multiple R-squared:  0.1786,    Adjusted R-squared:  0.1695 
F-statistic: 19.52 on 4 and 359 DF,  p-value: 1.51e-14
# Model with habit
model_exp1_media_habit <- lm(Media ~ Impuls. + Stress + Eat + Comp. + Automaticity + Routine, data = experiment_1_factors)
summary(model_exp1_media_habit)

Call:
lm(formula = Media ~ Impuls. + Stress + Eat + Comp. + Automaticity + 
    Routine, data = experiment_1_factors)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.40968 -0.57900 -0.03964  0.54912  2.93490 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept)  -0.991781   0.314620  -3.152  0.00176 ** 
Impuls.       0.104430   0.049859   2.095  0.03692 *  
Stress        0.299623   0.054824   5.465 8.70e-08 ***
Eat          -0.115162   0.050789  -2.267  0.02396 *  
Comp.         0.116703   0.054075   2.158  0.03158 *  
Automaticity  0.028348   0.005830   4.863 1.74e-06 ***
Routine       0.001909   0.005544   0.344  0.73075    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.8769 on 357 degrees of freedom
  (17 observations deleted due to missingness)
Multiple R-squared:  0.2351,    Adjusted R-squared:  0.2223 
F-statistic: 18.29 on 6 and 357 DF,  p-value: < 2.2e-16
# Model comparison
anova(model_exp1_media, model_exp1_media_habit)
Analysis of Variance Table

Model 1: Media ~ Impuls. + Stress + Eat + Comp.
Model 2: Media ~ Impuls. + Stress + Eat + Comp. + Automaticity + Routine
  Res.Df    RSS Df Sum of Sq      F    Pr(>F)    
1    359 294.81                                  
2    357 274.53  2    20.279 13.185 2.987e-06 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Compulsivity

# Model without habit
model_exp1_compulsivity <- lm(Comp. ~ Impuls. + Stress + Eat + Media, data = experiment_1_factors)
summary(model_exp1_compulsivity)

Call:
lm(formula = Comp. ~ Impuls. + Stress + Eat + Media, data = experiment_1_factors)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.25975 -0.63357 -0.09446  0.61354  2.78803 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  0.002549   0.046538   0.055   0.9564    
Impuls.     -0.114429   0.048299  -2.369   0.0184 *  
Stress       0.307260   0.055157   5.571 4.98e-08 ***
Eat          0.082116   0.051558   1.593   0.1121    
Media        0.128232   0.051253   2.502   0.0128 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.8877 on 359 degrees of freedom
  (17 observations deleted due to missingness)
Multiple R-squared:  0.1684,    Adjusted R-squared:  0.1591 
F-statistic: 18.17 on 4 and 359 DF,  p-value: 1.317e-13
# Model with habit
model_exp1_compulsivity_habit <- lm(Comp. ~ Impuls. + Stress + Eat + Media + Automaticity + Routine, data = experiment_1_factors)
summary(model_exp1_compulsivity_habit)

Call:
lm(formula = Comp. ~ Impuls. + Stress + Eat + Media + Automaticity + 
    Routine, data = experiment_1_factors)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.00990 -0.63747 -0.07449  0.62052  2.57265 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept)  -1.379240   0.301458  -4.575 6.57e-06 ***
Impuls.      -0.037716   0.048739  -0.774   0.4395    
Stress        0.299905   0.053179   5.640 3.47e-08 ***
Eat           0.077639   0.049572   1.566   0.1182    
Media         0.110354   0.051133   2.158   0.0316 *  
Automaticity -0.006812   0.005843  -1.166   0.2444    
Routine       0.029212   0.005166   5.655 3.20e-08 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.8527 on 357 degrees of freedom
  (17 observations deleted due to missingness)
Multiple R-squared:  0.2368,    Adjusted R-squared:  0.224 
F-statistic: 18.46 on 6 and 357 DF,  p-value: < 2.2e-16
# Model comparison
anova(model_exp1_compulsivity, model_exp1_compulsivity_habit)
Analysis of Variance Table

Model 1: Comp. ~ Impuls. + Stress + Eat + Media
Model 2: Comp. ~ Impuls. + Stress + Eat + Media + Automaticity + Routine
  Res.Df    RSS Df Sum of Sq      F    Pr(>F)    
1    359 282.87                                  
2    357 259.59  2    23.277 16.006 2.203e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Experiment 2

Media

# Model without habit
model_exp2_media <- lm(Media ~ Impuls. + Stress + Eat + Comp., data = experiment_2_factors)
summary(model_exp2_media)

Call:
lm(formula = Media ~ Impuls. + Stress + Eat + Comp., data = experiment_2_factors)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.29023 -0.59307 -0.01799  0.59344  2.74896 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept) -1.157443   0.319999  -3.617 0.000353 ***
Impuls.      0.025876   0.007056   3.667 0.000294 ***
Stress       0.258976   0.063619   4.071  6.1e-05 ***
Eat          0.038292   0.058794   0.651 0.515400    
Comp.        0.128939   0.055896   2.307 0.021796 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.8892 on 280 degrees of freedom
Multiple R-squared:  0.2205,    Adjusted R-squared:  0.2094 
F-statistic:  19.8 on 4 and 280 DF,  p-value: 2.281e-14
# Model with habit
model_exp2_media_habit <- lm(Media ~ Impuls. + Stress + Eat + Comp. + Automaticity + Routine, data = experiment_2_factors)
summary(model_exp2_media_habit)

Call:
lm(formula = Media ~ Impuls. + Stress + Eat + Comp. + Automaticity + 
    Routine, data = experiment_2_factors)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.39265 -0.53539 -0.01344  0.54716  2.82893 

Coefficients:
               Estimate Std. Error t value Pr(>|t|)    
(Intercept)  -1.6338757  0.4705081  -3.473 0.000598 ***
Impuls.       0.0171689  0.0072943   2.354 0.019283 *  
Stress        0.2279122  0.0626938   3.635 0.000331 ***
Eat           0.0014625  0.0577898   0.025 0.979828    
Comp.         0.1291316  0.0551789   2.340 0.019979 *  
Automaticity  0.0260938  0.0064656   4.036 7.04e-05 ***
Routine       0.0009244  0.0060943   0.152 0.879547    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.8642 on 278 degrees of freedom
Multiple R-squared:  0.2689,    Adjusted R-squared:  0.2531 
F-statistic: 17.04 on 6 and 278 DF,  p-value: < 2.2e-16
# Model comparison
anova(model_exp2_media, model_exp2_media_habit)
Analysis of Variance Table

Model 1: Media ~ Impuls. + Stress + Eat + Comp.
Model 2: Media ~ Impuls. + Stress + Eat + Comp. + Automaticity + Routine
  Res.Df    RSS Df Sum of Sq      F    Pr(>F)    
1    280 221.38                                  
2    278 207.64  2    13.737 9.1959 0.0001358 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Compulsivity

# Model without habit
model_exp2_compulsivity <- lm(Comp. ~ Impuls. + Stress + Eat + Media, data = experiment_2_factors)
summary(model_exp2_compulsivity)

Call:
lm(formula = Comp. ~ Impuls. + Stress + Eat + Media, data = experiment_2_factors)

Residuals:
    Min      1Q  Median      3Q     Max 
-2.4672 -0.5758 -0.1459  0.5457  3.2351 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)   
(Intercept) -0.318174   0.346231  -0.919   0.3589   
Impuls.      0.007113   0.007639   0.931   0.3526   
Stress       0.215889   0.068137   3.168   0.0017 **
Eat          0.042488   0.062267   0.682   0.4956   
Media        0.144643   0.062703   2.307   0.0218 * 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.9418 on 280 degrees of freedom
Multiple R-squared:  0.1256,    Adjusted R-squared:  0.1131 
F-statistic: 10.05 on 4 and 280 DF,  p-value: 1.292e-07
# Model with habit
model_exp2_compulsivity_habit <- lm(Comp. ~ Impuls. + Stress + Eat + Media + Automaticity + Routine, data = experiment_2_factors)
summary(model_exp2_compulsivity_habit)

Call:
lm(formula = Comp. ~ Impuls. + Stress + Eat + Media + Automaticity + 
    Routine, data = experiment_2_factors)

Residuals:
    Min      1Q  Median      3Q     Max 
-2.3843 -0.6058 -0.1178  0.5795  3.1893 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)   
(Intercept)  -1.266269   0.511711  -2.475  0.01394 * 
Impuls.       0.012423   0.007894   1.574  0.11669   
Stress        0.188485   0.068137   2.766  0.00605 **
Eat           0.048151   0.062137   0.775  0.43905   
Media         0.149613   0.063931   2.340  0.01998 * 
Automaticity -0.010791   0.007131  -1.513  0.13135   
Routine       0.018795   0.006463   2.908  0.00393 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.9303 on 278 degrees of freedom
Multiple R-squared:  0.1529,    Adjusted R-squared:  0.1346 
F-statistic: 8.363 on 6 and 278 DF,  p-value: 2.401e-08
# Model comparison
anova(model_exp2_compulsivity, model_exp2_compulsivity_habit)
Analysis of Variance Table

Model 1: Comp. ~ Impuls. + Stress + Eat + Media
Model 2: Comp. ~ Impuls. + Stress + Eat + Media + Automaticity + Routine
  Res.Df    RSS Df Sum of Sq      F  Pr(>F)  
1    280 248.34                              
2    278 240.58  2    7.7646 4.4862 0.01209 *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Replication of Experiment 1 to Experiment 2

Additional analysis conducted with subset of questionnaires used in both Experiments 1 and 2 to address Reviewer 2’s comments. This analysis can be found in the supporting information.

Experiment 1

Since the PMPUQ is not present in Experiment 2, the first step is to get the factor structure of the network without the PMPUQ for Experiment 1.

Extract factors from subscales

# Select subscales
var.subscales <- c("CESD_depressed",
                   "CESD_positive",
                   "CESD_somatic",
                   "CESD_relationship",
                   "EAT26_oral_control",
                   "EAT26_dieting",
                   "EAT26_bulimia",
                   "IAT_salience",
                   "IAT_excessive_use",
                   "IAT_neglect_work",
                   "IAT_anticipation",
                   "IAT_lack_control",
                   "IAT_neglect_social_life",
                   "OCIR_Washing",
                   "OCIR_checking",
                   "OCIR_ordering",
                   "OCIR_obsessing",
                   "OCIR_hoarding",
                   "OCIR_neutralising",
                   "PSS_total"
)

db.efa.exp1 <- experiment_1_items[var.subscales]
db.efa.descr1 = psych::describe(db.efa.exp1)

table_exp1_efa_descr <- knitr::kable(db.efa.descr1 , "html", caption = "Descriptive values for subscales used in Experiment 1") %>%
  kableExtra::kable_styling(latex_options = "HOLD_position", position = "center", full_width = F) %>%
  row_spec(0,bold=T,align='c')

table_exp1_efa_descr 
Descriptive values for subscales used in Experiment 1
vars n mean sd median trimmed mad min max range skew kurtosis se
CESD_depressed 1 381 6.606299 4.930823 6 6.1573770 5.9304 0 21 21 0.7048287 -0.2391031 0.2526137
CESD_positive 2 381 5.732284 2.855601 6 5.7114754 2.9652 0 12 12 0.0060894 -0.7263802 0.1462969
CESD_somatic 3 381 7.422572 4.462406 7 7.1737705 4.4478 0 21 21 0.5230276 -0.3024748 0.2286160
CESD_relationship 4 381 1.089239 1.336694 1 0.8622951 1.4826 0 6 6 1.2417699 0.9414994 0.0684809
EAT26_oral_control 5 381 2.545932 2.375559 2 2.1967213 1.4826 0 13 13 1.4013928 2.0549548 0.1217036
EAT26_dieting 6 381 4.748031 5.584238 3 3.6950820 2.9652 0 30 30 1.9298654 4.0637404 0.2860892
EAT26_bulimia 7 381 1.556430 2.293031 1 1.0524590 1.4826 0 14 14 2.2028515 5.6048518 0.1174755
IAT_salience 8 381 7.997375 3.580281 7 7.8229508 2.9652 0 19 19 0.4972913 0.4040359 0.1834234
IAT_excessive_use 9 381 11.524934 3.864485 11 11.3704918 4.4478 3 23 20 0.3628161 -0.1521417 0.1979836
IAT_neglect_work 10 381 5.913386 2.852580 5 5.6950820 2.9652 0 14 14 0.6204031 0.0065720 0.1461421
IAT_anticipation 11 381 4.338583 2.019199 4 4.2032787 1.4826 0 10 10 0.4777398 -0.3447611 0.1034467
IAT_lack_control 12 381 6.834646 2.979130 7 6.7442623 2.9652 0 14 14 0.2058543 -0.4253244 0.1526255
IAT_neglect_social_life 13 381 2.425197 1.524466 2 2.3278689 1.4826 0 9 9 0.8195238 1.2668396 0.0781007
OCIR_Washing 14 381 2.800525 2.761979 2 2.4196721 2.9652 0 12 12 1.0045044 0.4964440 0.1415005
OCIR_checking 15 381 3.036745 2.593253 3 2.6950820 2.9652 0 12 12 1.1923126 1.3312559 0.1328564
OCIR_ordering 16 381 4.784777 3.022874 5 4.6295082 2.9652 0 12 12 0.3960232 -0.5967044 0.1548665
OCIR_obsessing 17 381 4.217848 3.060323 4 4.0098361 2.9652 0 12 12 0.5118225 -0.5310952 0.1567851
OCIR_hoarding 18 381 3.895013 2.810601 3 3.7344262 2.9652 0 12 12 0.4603216 -0.5317544 0.1439914
OCIR_neutralising 19 381 1.488189 1.972973 1 1.0950820 1.4826 0 8 8 1.4262309 1.3040482 0.1010785
PSS_total 20 381 30.532808 7.094631 30 30.6426230 7.4130 10 48 38 -0.1230933 -0.2817949 0.3634690

Verify postulates with KMO and Barlett test:

# Verify postulates
KMO(db.efa.exp1)
Kaiser-Meyer-Olkin factor adequacy
Call: KMO(r = db.efa.exp1)
Overall MSA =  0.87
MSA for each item = 
         CESD_depressed           CESD_positive            CESD_somatic 
                   0.85                    0.91                    0.90 
      CESD_relationship      EAT26_oral_control           EAT26_dieting 
                   0.90                    0.84                    0.75 
          EAT26_bulimia            IAT_salience       IAT_excessive_use 
                   0.72                    0.89                    0.87 
       IAT_neglect_work        IAT_anticipation        IAT_lack_control 
                   0.89                    0.88                    0.87 
IAT_neglect_social_life            OCIR_Washing           OCIR_checking 
                   0.85                    0.86                    0.85 
          OCIR_ordering          OCIR_obsessing           OCIR_hoarding 
                   0.82                    0.94                    0.88 
      OCIR_neutralising               PSS_total 
                   0.84                    0.93 
cor_matrix <- cor(db.efa.exp1, use = "complete.obs")

cortest.bartlett(cor_matrix, n = nrow(db.efa.exp1))
$chisq
[1] 3774.764

$p.value
[1] 0

$df
[1] 190

First, use parallel analysis method:

nFact  <- fa.parallel(db.efa.exp1, fm = "ml")

Parallel analysis suggests that the number of factors =  4  and the number of components =  4 

Second, use VSS method:

nFact  <- vss(db.efa.exp1) 

Third, nScree method:

nFact  <- nScree(x = na.omit(db.efa.exp1), model = "factors") 

plotnScree(nFact) 

Try method “comparisons data”:

nFact <- EFACompData(na.omit(db.efa.exp1), 8, n.pop = 10000, n.samples = 500, alpha = .30, graph = T,
                     corr.type = "pearson")
Number of factors to retain:  4 

Apply EFA with 4 factors and an oblimin rotation
quest.1.efa1 <- fa(r = db.efa.exp1, nfactors =4, rotate = "oblimin", fm = "ml")

print(quest.1.efa1$loadings, cutoff = 0.2)

Loadings:
                        ML1    ML3    ML2    ML4   
CESD_depressed           0.981                     
CESD_positive            0.724                     
CESD_somatic             0.813                     
CESD_relationship        0.660                     
EAT26_oral_control                     0.710       
EAT26_dieting                          0.931       
EAT26_bulimia                          0.875       
IAT_salience                    0.706              
IAT_excessive_use               0.865              
IAT_neglect_work                0.788              
IAT_anticipation                0.731              
IAT_lack_control                0.810              
IAT_neglect_social_life         0.322              
OCIR_Washing                                  0.618
OCIR_checking                                 0.664
OCIR_ordering                                 0.687
OCIR_obsessing           0.391                0.319
OCIR_hoarding                                 0.426
OCIR_neutralising                             0.485
PSS_total                0.698                     

                 ML1   ML3   ML2   ML4
SS loadings    3.263 3.260 2.162 1.854
Proportion Var 0.163 0.163 0.108 0.093
Cumulative Var 0.163 0.326 0.434 0.527
Compute factor scores

We compute factor scores but importantly we assess factor indeterminacy to control if the factors can be used as predictors.

s.exp1 = factor.scores (db.efa.exp1, quest.1.efa1) #
s.exp1$R2
      ML1       ML3       ML2       ML4 
0.9657857 0.9495431 0.9629158 0.8768205 
Plot correlation matrix between factors

Extract transdiagnostic factors based on the EFA
# Get loadings into a dataset
load = quest.1.efa1$loadings
load = load[]
load = data.frame(load)
setDT(load,keep.rownames=TRUE)[]
                         rn          ML1           ML3          ML2
                     <char>        <num>         <num>        <num>
 1:          CESD_depressed  0.980613417 -0.0880134499 -0.021924944
 2:           CESD_positive  0.724031209  0.0308536240  0.045967345
 3:            CESD_somatic  0.813441557  0.0480757241  0.017852167
 4:       CESD_relationship  0.660406651  0.0207043026  0.062748352
 5:      EAT26_oral_control -0.043839399 -0.0383490553  0.710356860
 6:           EAT26_dieting  0.043145916  0.0007306995  0.930795316
 7:           EAT26_bulimia -0.019478246  0.0196953976  0.874633797
 8:            IAT_salience  0.045266788  0.7056046445  0.047913788
 9:       IAT_excessive_use -0.010321126  0.8648307500 -0.025203369
10:        IAT_neglect_work -0.015100086  0.7884863698  0.030224284
11:        IAT_anticipation  0.008211349  0.7311960589  0.043788580
12:        IAT_lack_control  0.003191258  0.8103293299 -0.055497524
13: IAT_neglect_social_life  0.090209729  0.3222155733 -0.021573371
14:            OCIR_Washing  0.002780668  0.0199054523  0.008604014
15:           OCIR_checking  0.066018347 -0.0276449880  0.027355097
16:           OCIR_ordering -0.041296124 -0.0829349412  0.019908550
17:          OCIR_obsessing  0.390513442  0.1298359673  0.065157380
18:           OCIR_hoarding  0.111140651  0.1378324004 -0.063811602
19:       OCIR_neutralising -0.078924567  0.1513113822  0.003857711
20:               PSS_total  0.697890379  0.1299863973 -0.027572635
                         rn          ML1           ML3          ML2
             ML4
           <num>
 1: -0.028957344
 2: -0.041125697
 3:  0.029663776
 4: -0.007105379
 5:  0.102406339
 6:  0.003907176
 7: -0.050527662
 8:  0.079661720
 9: -0.011654395
10: -0.074745195
11: -0.049009155
12:  0.060560768
13:  0.006242041
14:  0.618001763
15:  0.663539522
16:  0.686718734
17:  0.318981613
18:  0.425811081
19:  0.485468522
20:  0.080197095
             ML4
colnames(load)[1] <- "Subscale"

loadings.m <- melt(load, id="Subscale",
                   measure=c("ML3", "ML1","ML2", "ML4"),
                   variable.name="Factor", value.name="Loading")


# Name factors
labels <- c(ML3 = "Media", ML1 = "Stress",
            ML2 = "Eat", ML4 = "Comp.")

loadings.m$subscales = fact_col_new

loadings.m$subscales <- factor(loadings.m$subscales, levels = loadings.m$subscales[seq (1:20)])

pp <- ggplot(loadings.m, aes(subscales, abs(Loading), fill=Loading)) +
  facet_wrap(~ Factor, nrow=1, labeller = labeller(Factor = labels) ) +
  geom_bar(stat="identity") + #make the bars
  coord_flip() + #flip the axes so the test names can be horizontal
  scale_fill_gradient2(name = "Loading",
                       high = "#006666", mid = "white", low = "goldenrod4",
                       midpoint=0, guide=F) +
  scale_x_discrete(limits = rev(levels(loadings.m$subscales)))+
  ylab("Loading Strength") +
  theme_bw(base_size=10)

# Make plot nicer
ppp <-   pp + theme_bw(base_size = 10, base_family = "Helvetica")+
  theme(strip.text.x = element_text(size = 15, face = "bold"),
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(),
        strip.background = element_rect(color="white", fill="white", linetype="solid"),
        axis.title.x = element_text(size = 12),
        axis.text.y = element_blank(),
        axis.title.y = element_blank(),
        legend.position = "none")

ppp

dev.print(pdf, file.path(figures_path, "experiment_1_factors_replication.pdf"))
quartz_off_screen 
                2 
dev.off()
null device 
          1 
Factors correlations
var.net = c("COHS_automaticity", "COHS_routine","UPPS_total" )
db.network.tmp1 <- experiment_1_items[var.net]

# Merge with full database
axes.exp1 <- s.exp1$scores

# Combine
db.network.exp1 <- cbind(db.network.tmp1, axes.exp1)

# Rename with interpreted factors
old_names = c("COHS_automaticity", "COHS_routine", "UPPS_total",
               "ML1","ML3","ML2","ML4")

new_names <- c("Automaticity","Routine","Impuls.",
               "Stress","Media","Eat","Comp.")

colors <- c(pal[8], pal[8],pal[8],
            pal[9], pal[9], pal[9],
            pal[9])

colnames(db.network.exp1)[colnames(db.network.exp1) == old_names] <- new_names

# Descriptive correlation
factor_corr_plot <- cpplus(
  db.network.exp1,
  reorder=FALSE,
  alpha=0.05
  )

 0 missing correlations set to zero

dev.print(pdf, file.path(figures_path, "experiment_1_factors_correlation_replication.pdf"))
quartz_off_screen 
                2 
dev.off()
null device 
          1 

Dynamic network analysis

Centrality table:

mynetwork.exp1 <- estimateNetwork(db.network.exp1, default ="EBICglasso") # EBIC hyperparameter is set to 0.5
Estimating Network. Using package::function:
  - qgraph::EBICglasso for EBIC model selection
    - using glasso::glasso
CentralityTable <- centralityTable(mynetwork.exp1)

EITable <- subset(CentralityTable, measure == "ExpectedInfluence")

table_exp1_ei <- knitr::kable(EITable , "html", caption = "Centrality Table Experiment 1") %>%
 kableExtra::kable_styling(latex_options = "HOLD_position", position = "center", full_width = F) %>%
  row_spec(0,bold=T,align='c')

table_exp1_ei
Centrality Table Experiment 1
graph type node measure value
22 graph 1 NA Automaticity ExpectedInfluence 0.3959310
23 graph 1 NA Routine ExpectedInfluence -1.0488587
24 graph 1 NA Impuls. ExpectedInfluence -1.3823646
25 graph 1 NA Stress ExpectedInfluence 1.4003370
26 graph 1 NA Media ExpectedInfluence 0.4935566
27 graph 1 NA Eat ExpectedInfluence -0.4850270
28 graph 1 NA Comp. ExpectedInfluence 0.6264257
nledges <- getWmat(mynetwork.exp1)

plot_network.exp1 <- qgraph(nledges,
       layout = "spring",
       labels = new_names,
       label.scale = F,
       label.cex = 1,
       edge.labels = F,
       color = colors,
       border.color = colors,
       border.width = 4,
       node.width = 0.9,
       posCol = c("#006666","#006666"),
       negCol = c("goldenrod4","goldenrod4"),
       vTrans = 150,
       label.font = 2
       )

dev.print(pdf, file.path(figures_path, "experiment_1_network_revision.pdf"))
quartz_off_screen 
                2 
print(plot_network.exp1)
From        To  Weight
1    ---     2   0.16 
1    ---     3   0.13 
2    ---     3   -0.22 
1    ---     4   0.07 
3    ---     4   0.08 
1    ---     5   0.23 
3    ---     5   0.08 
4    ---     5   0.22 
4    ---     6   0.26 
2    ---     7   0.23 
4    ---     7   0.26 
5    ---     7   0.09 
6    ---     7   0.08 
NULL
dev.off()
null device 
          1 
Estimate network edge weights accuracy and centrality measures stability

First for edges:

set.seed(1331)
b1 <- bootnet(mynetwork.exp1,  nBoots= 10000, nCores = 1,
              statistics = c("strength","expectedInfluence","edge"),caseN = 50)

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |                                                                      |   1%
  |                                                                            
  |=                                                                     |   1%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |==                                                                    |   4%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=======                                                               |  11%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |=========                                                             |  14%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |============                                                          |  16%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |============                                                          |  18%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |================                                                      |  24%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |=================                                                     |  25%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |===================                                                   |  26%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |===================                                                   |  28%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  29%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=======================                                               |  34%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |==========================                                            |  36%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |============================                                          |  39%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |============================                                          |  41%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |==============================                                        |  44%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |=================================                                     |  46%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |=================================                                     |  48%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |===================================                                   |  49%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |===================================                                   |  51%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=====================================                                 |  54%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  56%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |==========================================                            |  59%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |==========================================                            |  61%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |============================================                          |  64%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |===============================================                       |  66%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |=================================================                     |  71%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |===================================================                   |  74%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=====================================================                 |  75%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  76%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |==========================================================            |  84%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  86%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |===============================================================       |  89%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |====================================================================  |  96%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |===================================================================== |  99%
  |                                                                            
  |======================================================================|  99%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |                                                                      |   1%
  |                                                                            
  |=                                                                     |   1%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |==                                                                    |   4%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=======                                                               |  11%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |=========                                                             |  14%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |============                                                          |  16%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |============                                                          |  18%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |================                                                      |  24%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |=================                                                     |  25%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |===================                                                   |  26%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |===================                                                   |  28%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  29%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=======================                                               |  34%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |==========================                                            |  36%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |============================                                          |  39%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |============================                                          |  41%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |==============================                                        |  44%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |=================================                                     |  46%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |=================================                                     |  48%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |===================================                                   |  49%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |===================================                                   |  51%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=====================================                                 |  54%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  56%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |==========================================                            |  59%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |==========================================                            |  61%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |============================================                          |  64%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |===============================================                       |  66%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |=================================================                     |  71%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |===================================================                   |  74%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=====================================================                 |  75%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  76%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |==========================================================            |  84%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  86%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |===============================================================       |  89%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |====================================================================  |  96%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |===================================================================== |  99%
  |                                                                            
  |======================================================================|  99%
  |                                                                            
  |======================================================================| 100%
tb.b1 = summary(b1)

table_exp1_boot <- knitr::kable(tb.b1 , "html", caption = "Table Experiment 1") %>%
 kableExtra::kable_styling(latex_options = "HOLD_position", position = "center", full_width = F) %>%
  row_spec(0,bold=T,align='c')

table_exp1_boot
Table Experiment 1
type id node1 node2 sample mean sd CIlower CIupper q2.5 q97.5 q2.5_non0 mean_non0 q97.5_non0 var_non0 sd_non0 prop0
edge Automaticity--Comp. Automaticity Comp. 0.0000000 -0.0066538 0.0261985 -0.0523970 0.0523970 -0.0949055 0.0162263 -0.1501902 -0.0447463 0.0503733 0.0029127 0.0539698 0.8513
edge Automaticity--Eat Automaticity Eat 0.0000000 0.0150068 0.0314847 -0.0629695 0.0629695 0.0000000 0.1013211 -0.0530475 0.0445569 0.1234889 0.0016268 0.0403334 0.6632
edge Automaticity--Impuls. Automaticity Impuls. 0.1343794 0.1253640 0.0537999 0.0267796 0.2419792 0.0000000 0.2291786 0.0371442 0.1292279 0.2298965 0.0024843 0.0498425 0.0299
edge Automaticity--Media Automaticity Media 0.2312635 0.2254058 0.0449182 0.1414271 0.3210999 0.1359161 0.3117407 0.1359423 0.2254283 0.3117418 0.0020128 0.0448638 0.0001
edge Automaticity--Routine Automaticity Routine 0.1633940 0.1537332 0.0581702 0.0470536 0.2797344 0.0381891 0.2680663 0.0502382 0.1557897 0.2683629 0.0031086 0.0557552 0.0132
edge Automaticity--Stress Automaticity Stress 0.0718498 0.0713156 0.0462907 -0.0207316 0.1644312 0.0000000 0.1668390 0.0105274 0.0788977 0.1689374 0.0017724 0.0420999 0.0961
edge Eat--Comp. Eat Comp. 0.0812043 0.0821678 0.0563357 -0.0314671 0.1938756 0.0000000 0.1970333 0.0145312 0.0942723 0.1999780 0.0025000 0.0500004 0.1284
edge Impuls.--Comp. Impuls. Comp. 0.0000000 -0.0032867 0.0191759 -0.0383519 0.0383519 -0.0617398 0.0273028 -0.1022273 -0.0245462 0.0760733 0.0022258 0.0471779 0.8661
edge Impuls.--Eat Impuls. Eat 0.0000000 0.0152896 0.0308469 -0.0616938 0.0616938 0.0000000 0.0982828 -0.0500948 0.0451821 0.1212383 0.0014614 0.0382282 0.6616
edge Impuls.--Media Impuls. Media 0.0839762 0.0844208 0.0481341 -0.0122920 0.1802443 0.0000000 0.1811883 0.0192412 0.0914041 0.1829360 0.0018702 0.0432457 0.0764
edge Impuls.--Stress Impuls. Stress 0.0810563 0.0700900 0.0431941 -0.0053318 0.1674444 0.0000000 0.1565831 0.0154923 0.0785586 0.1589501 0.0014258 0.0377601 0.1078
edge Media--Comp. Media Comp. 0.0949497 0.0913804 0.0468675 0.0012147 0.1886847 0.0000000 0.1847076 0.0180600 0.0956362 0.1866231 0.0018918 0.0434951 0.0445
edge Media--Eat Media Eat 0.0000000 -0.0203154 0.0415599 -0.0831199 0.0831199 -0.1370609 0.0000000 -0.1767828 -0.0718111 0.0327255 0.0024077 0.0490684 0.7171
edge Routine--Comp. Routine Comp. 0.2332279 0.2276178 0.0480579 0.1371121 0.3293436 0.1322962 0.3205705 0.1322962 0.2276178 0.3205705 0.0023096 0.0480579 0.0000
edge Routine--Eat Routine Eat 0.0000000 0.0028955 0.0265913 -0.0531825 0.0531825 -0.0595926 0.0728561 -0.0972231 0.0127051 0.1051797 0.0029790 0.0545804 0.7721
edge Routine--Impuls. Routine Impuls. -0.2168611 -0.2050160 0.0552275 -0.3273162 -0.1064060 -0.3126895 -0.0968553 -0.3127641 -0.2052828 -0.0981631 0.0029993 0.0547655 0.0013
edge Routine--Media Routine Media 0.0000000 0.0145295 0.0302689 -0.0605377 0.0605377 0.0000000 0.0968605 -0.0523754 0.0451787 0.1238914 0.0014644 0.0382671 0.6784
edge Routine--Stress Routine Stress 0.0000000 -0.0137546 0.0334326 -0.0668651 0.0668651 -0.1161615 0.0000000 -0.1522487 -0.0606999 0.0382255 0.0020835 0.0456453 0.7734
edge Stress--Comp. Stress Comp. 0.2586892 0.2559304 0.0474986 0.1636920 0.3536864 0.1605398 0.3478813 0.1605398 0.2559304 0.3478813 0.0022561 0.0474986 0.0000
edge Stress--Eat Stress Eat 0.2629016 0.2579571 0.0458742 0.1711532 0.3546499 0.1683558 0.3499541 0.1683558 0.2579571 0.3499541 0.0021044 0.0458742 0.0000
edge Stress--Media Stress Media 0.2191531 0.2213666 0.0403730 0.1384070 0.2998991 0.1434018 0.3013378 0.1434018 0.2213666 0.3013378 0.0016300 0.0403730 0.0000
strength Automaticity Automaticity 0.6008866 0.6018740 0.1240240 0.3528386 0.8489346 0.3699243 0.8757543 0.3699243 0.6018740 0.8757543 0.0153820 0.1240240 0.0000
strength Comp. Comp. 0.6680710 0.6722203 0.1077504 0.4525703 0.8835717 0.4805660 0.9141525 0.4805660 0.6722203 0.9141525 0.0116101 0.1077504 0.0000
strength Eat Eat 0.3441058 0.4075960 0.1133047 0.1174965 0.5707152 0.2399291 0.6946734 0.2399291 0.4075960 0.6946734 0.0128379 0.1133047 0.0000
strength Impuls. Impuls. 0.5162729 0.5086236 0.1251448 0.2659834 0.7665624 0.2614218 0.7660324 0.2616497 0.5087254 0.7660389 0.0156126 0.1249503 0.0002
strength Media Media 0.6293424 0.6605705 0.1218701 0.3856022 0.8730826 0.4401396 0.9296572 0.4401396 0.6605705 0.9296572 0.0148523 0.1218701 0.0000
strength Routine Routine 0.6134829 0.6289363 0.1400752 0.3333325 0.8936333 0.3764385 0.9382787 0.3764385 0.6289363 0.9382787 0.0196211 0.1400752 0.0000
strength Stress Stress 0.8936499 0.8917288 0.1096950 0.6742600 1.1130398 0.6921296 1.1341215 0.6921296 0.8917288 1.1341215 0.0120330 0.1096950 0.0000
plot (b1, plot = "interval", split0 = TRUE, order="sample", labels=T)

And for centrality indices:

set.seed(1331)
b2 <- bootnet(mynetwork.exp1,nBoots= 10000, nCores = 1, type = "case",
              statistics = c("strength","expectedInfluence","edge"),caseN = 50)

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |                                                                      |   1%
  |                                                                            
  |=                                                                     |   1%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |==                                                                    |   4%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=======                                                               |  11%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |=========                                                             |  14%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |============                                                          |  16%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |============                                                          |  18%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |================                                                      |  24%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |=================                                                     |  25%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |===================                                                   |  26%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |===================                                                   |  28%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  29%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=======================                                               |  34%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |==========================                                            |  36%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |============================                                          |  39%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |============================                                          |  41%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |==============================                                        |  44%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |=================================                                     |  46%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |=================================                                     |  48%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |===================================                                   |  49%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |===================================                                   |  51%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=====================================                                 |  54%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  56%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |==========================================                            |  59%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |==========================================                            |  61%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |============================================                          |  64%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |===============================================                       |  66%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |=================================================                     |  71%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |===================================================                   |  74%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=====================================================                 |  75%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  76%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |==========================================================            |  84%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  86%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |===============================================================       |  89%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |====================================================================  |  96%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |===================================================================== |  99%
  |                                                                            
  |======================================================================|  99%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |                                                                      |   1%
  |                                                                            
  |=                                                                     |   1%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |==                                                                    |   4%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=======                                                               |  11%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |=========                                                             |  14%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |============                                                          |  16%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |============                                                          |  18%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |================                                                      |  24%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |=================                                                     |  25%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |===================                                                   |  26%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |===================                                                   |  28%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  29%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=======================                                               |  34%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |==========================                                            |  36%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |============================                                          |  39%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |============================                                          |  41%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |==============================                                        |  44%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |=================================                                     |  46%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |=================================                                     |  48%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |===================================                                   |  49%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |===================================                                   |  51%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=====================================                                 |  54%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  56%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |==========================================                            |  59%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |==========================================                            |  61%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |============================================                          |  64%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |===============================================                       |  66%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |=================================================                     |  71%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |===================================================                   |  74%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=====================================================                 |  75%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  76%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |==========================================================            |  84%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  86%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |===============================================================       |  89%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |====================================================================  |  96%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |===================================================================== |  99%
  |                                                                            
  |======================================================================|  99%
  |                                                                            
  |======================================================================| 100%
corStability(b2)
=== Correlation Stability Analysis === 

Sampling levels tested:
   nPerson Drop%   n
1       95  75.1 184
2      101  73.5 178
3      106  72.2 177
4      112  70.6 182
5      117  69.3 202
6      122  68.0 202
7      128  66.4 185
8      133  65.1 192
9      139  63.5 201
10     144  62.2 206
11     150  60.6 209
12     155  59.3 233
13     161  57.7 237
14     166  56.4 220
15     171  55.1 190
16     177  53.5 187
17     182  52.2 236
18     188  50.7 199
19     193  49.3 201
20     199  47.8 178
21     204  46.5 197
22     210  44.9 202
23     215  43.6 177
24     220  42.3 224
25     226  40.7 185
26     231  39.4 200
27     237  37.8 187
28     242  36.5 189
29     248  34.9 188
30     253  33.6 219
31     259  32.0 217
32     264  30.7 190
33     269  29.4 197
34     275  27.8 206
35     280  26.5 190
36     286  24.9 203
37     291  23.6 184
38     297  22.0 201
39     302  20.7 177
40     308  19.2 208
41     313  17.8 195
42     318  16.5 208
43     324  15.0 201
44     329  13.6 204
45     335  12.1 218
46     340  10.8 223
47     346   9.2 189
48     351   7.9 207
49     357   6.3 208
50     362   5.0 207

Maximum drop proportions to retain correlation of 0.7 in at least 95% of the samples:

edge: 0.522 
  - For more accuracy, run bootnet(..., caseMin = 0.507, caseMax = 0.535) 

expectedInfluence: 0.564 
  - For more accuracy, run bootnet(..., caseMin = 0.551, caseMax = 0.577) 

strength: 0.478 
  - For more accuracy, run bootnet(..., caseMin = 0.465, caseMax = 0.493) 

Accuracy can also be increased by increasing both 'nBoots' and 'caseN'.
plot (b2, c("expectedInfluence")) # Centrality stability graph

Experiment 2

Extract factors from subscales

# Select subscales
var.subscales <- c("CESD_depressed",
                   "CESD_positive",
                   "CESD_somatic",
                   "CESD_relationship",
                   "EAT26_oral_control",
                   "EAT26_dieting",
                   "EAT26_bulimia",
                   "IAT_salience",
                   "IAT_excessive_use",
                   "IAT_neglect_work",
                   "IAT_anticipation",
                   "IAT_lack_control",
                   "IAT_neglect_social_life",
                   "OCIR_washing",
                   "OCIR_checking",
                   "OCIR_ordering",
                   "OCIR_obsessing",
                   "OCIR_hearding",
                   "OCIR_neutralising",
                   "PSS_total")

# db.subscales <- experiment_2_items[var.subscales]
db.efa.exp2 <- experiment_2_items[var.subscales]

db.efa.descr2 = psych::describe(db.efa.exp2)

table_exp2_efa_descr <- knitr::kable(db.efa.descr2 , "html", caption = "Descriptive values for subscales used in Experiment 2") %>%
  kableExtra::kable_styling(latex_options = "HOLD_position", position = "center", full_width = F) %>%
  row_spec(0,bold=T,align='c')

table_exp2_efa_descr 
Descriptive values for subscales used in Experiment 2
vars n mean sd median trimmed mad min max range skew kurtosis se
CESD_depressed 1 285 6.403509 5.416653 5 5.8340611 5.9304 0 21 21 0.7542648 -0.2611829 0.3208548
CESD_positive 2 285 5.487719 3.131624 5 5.4104803 2.9652 0 12 12 0.2162405 -0.7224648 0.1855014
CESD_somatic 3 285 7.014035 4.372587 6 6.7554585 4.4478 0 19 19 0.4911912 -0.5306013 0.2590097
CESD_relationship 4 285 1.164912 1.457435 1 0.9126638 1.4826 0 6 6 1.2436609 0.7830325 0.0863310
EAT26_oral_control 5 285 1.989474 2.740520 1 1.4148472 1.4826 0 13 13 1.8438986 3.2490191 0.1623344
EAT26_dieting 6 285 8.207017 7.301550 5 7.0567686 4.4478 0 35 35 1.4285071 1.5678677 0.4325065
EAT26_bulimia 7 285 1.908772 3.027822 0 1.2227074 0.0000 0 16 16 2.0617651 4.2953491 0.1793527
IAT_salience 8 285 8.701754 3.863721 8 8.3231441 2.9652 0 25 25 1.0965678 1.8680557 0.2288671
IAT_excessive_use 9 285 11.631579 4.449369 11 11.3886463 4.4478 1 24 23 0.4265240 -0.4827428 0.2635579
IAT_neglect_work 10 285 5.575439 2.799414 5 5.3187773 2.9652 0 15 15 0.8463253 0.8539063 0.1658230
IAT_anticipation 11 285 4.484210 2.077020 4 4.3668122 1.4826 0 10 10 0.4275831 -0.0690404 0.1230320
IAT_lack_control 12 285 6.835088 2.974806 7 6.7074236 2.9652 0 15 15 0.3915463 -0.4658393 0.1762123
IAT_neglect_social_life 13 285 2.578947 1.751733 2 2.4410480 1.4826 0 10 10 0.9282741 1.1247427 0.1037637
OCIR_washing 14 285 2.382456 2.655921 2 1.9563319 2.9652 0 12 12 1.2444379 0.9985864 0.1573232
OCIR_checking 15 285 2.824561 2.412722 2 2.5807860 1.4826 0 12 12 0.8737978 0.2350271 0.1429173
OCIR_ordering 16 285 4.442105 2.931312 4 4.3318777 2.9652 0 12 12 0.3113166 -0.7472373 0.1736359
OCIR_obsessing 17 285 4.119298 3.309155 4 3.8296943 4.4478 0 12 12 0.5914761 -0.5292896 0.1960174
OCIR_hearding 18 285 3.466667 2.772433 3 3.2314410 2.9652 0 12 12 0.6539935 -0.3129235 0.1642248
OCIR_neutralising 19 285 1.442105 2.177263 0 0.9606987 0.0000 0 11 11 2.0219755 4.1271402 0.1289699
PSS_total 20 285 29.256140 7.633392 30 29.1834061 7.4130 12 48 36 0.0451084 -0.6215054 0.4521631

Verify postulates with KMO and Bartlett test:

KMO (db.efa.exp2)
Kaiser-Meyer-Olkin factor adequacy
Call: KMO(r = db.efa.exp2)
Overall MSA =  0.88
MSA for each item = 
         CESD_depressed           CESD_positive            CESD_somatic 
                   0.88                    0.89                    0.94 
      CESD_relationship      EAT26_oral_control           EAT26_dieting 
                   0.91                    0.86                    0.67 
          EAT26_bulimia            IAT_salience       IAT_excessive_use 
                   0.70                    0.88                    0.88 
       IAT_neglect_work        IAT_anticipation        IAT_lack_control 
                   0.91                    0.88                    0.89 
IAT_neglect_social_life            OCIR_washing           OCIR_checking 
                   0.82                    0.89                    0.89 
          OCIR_ordering          OCIR_obsessing           OCIR_hearding 
                   0.86                    0.91                    0.92 
      OCIR_neutralising               PSS_total 
                   0.88                    0.94 
cor_matrix <- cor(db.efa.exp2, use = "complete.obs")

cortest.bartlett(cor_matrix, n = nrow(db.efa.exp2))
$chisq
[1] 2934.54

$p.value
[1] 0

$df
[1] 190

First, use parallel analysis method:

nFact  <- fa.parallel(db.efa.exp2, fm = "ml") 

Parallel analysis suggests that the number of factors =  4  and the number of components =  4 

Second, use VSS method:

nFact <- vss(db.efa.exp2)

Third, nScree method:

nFact  <- nScree(x = na.omit(db.efa.exp2), model = "factors") 
plotnScree(nFact) 

Try method “comparisons data”:

nFact <- EFACompData(na.omit(db.efa.exp2), 10, n.pop = 10000, n.samples = 500, alpha = .30, graph = T,corr.type = "pearson") 
Number of factors to retain:  4 

Apply EFA with oblimin rotation
quest.sc.efa2 <- fa(r = db.efa.exp2, nfactors =4, rotate = "oblimin", fm = "ml") 
print(quest.sc.efa2$loadings,cutoff = 0.2)

Loadings:
                        ML2    ML3    ML4    ML1   
CESD_depressed           0.925                     
CESD_positive            0.851                     
CESD_somatic             0.770                     
CESD_relationship        0.540                     
EAT26_oral_control                     0.352  0.243
EAT26_dieting                                 0.777
EAT26_bulimia                                 0.992
IAT_salience                    0.690              
IAT_excessive_use               0.870              
IAT_neglect_work                0.743              
IAT_anticipation                0.734              
IAT_lack_control                0.794              
IAT_neglect_social_life -0.224  0.452  0.216       
OCIR_washing                           0.668       
OCIR_checking                          0.695       
OCIR_ordering                          0.582       
OCIR_obsessing           0.484         0.378       
OCIR_hearding            0.241         0.392       
OCIR_neutralising                      0.649       
PSS_total                0.732                     

                 ML2   ML3   ML4   ML1
SS loadings    3.357 3.234 2.222 1.692
Proportion Var 0.168 0.162 0.111 0.085
Cumulative Var 0.168 0.330 0.441 0.525
Compute factor scores

We compute factor scores but importantly we assess factor indeterminacy to control if the factors can be used as predictors.

s.exp2 = factor.scores (db.efa.exp2, quest.sc.efa2) 
s.exp2$R2
      ML2       ML3       ML4       ML1 
0.9645314 0.9532799 0.8996608 0.9974283 
Plot correlation matrix of all subscales
fact_col_new  <- c( "CESD: depr.",
                   "CESD: pos.",
                   "CESD: somatic",
                   "CESD: relation.",
                   "EAT: oral contr.",
                   "EAT: dieting",
                   "EAT: bulimia",
                   "IAT: salience",
                   "IAT: exces. use",
                   "IAT: negl. work",
                   "IAT: anticip.",
                   "IAT: lack contr.",
                   "IAT: negl. social",
                   "OCI: wash.",
                   "OCI: check.",
                   "OCI: order.",
                   "OCI: obsess.",
                   "OCI: hoard.",
                   "OCI: neutr.",
                   "PSS")

col_old = var.subscales

colnames(db.efa.exp2)[colnames(db.efa.exp2) == var.subscales] <- fact_col_new
corrmatrix <- cor(db.efa.exp2, use="complete.obs")
col1 <- colorRampPalette(brewer.pal(9,"BrBG"))
corrplot(corrmatrix,method = "square", tl.col = "black", tl.cex = 0.5, sig.level = 0.05, insig = "pch", pch.cex = 1, col = col1(100))

dev.print(pdf, file.path(figures_path, "experiment_2_correlation_matrix_replication.pdf"))
quartz_off_screen 
                2 
dev.off()
null device 
          1 
Extract transdiagnostic factors based on the EFA
# Get loadings into a dataset
load = quest.sc.efa2$loadings
load = load[]
load = data.frame(load)
setDT(load,keep.rownames=TRUE)[]
                         rn           ML2          ML3          ML4
                     <char>         <num>        <num>        <num>
 1:          CESD_depressed  0.9246753636  0.005141345 -0.023221234
 2:           CESD_positive  0.8506551750 -0.091753316 -0.042297815
 3:            CESD_somatic  0.7695580997  0.169785203 -0.033628419
 4:       CESD_relationship  0.5400342778  0.055979032  0.195948344
 5:      EAT26_oral_control -0.0952495569 -0.073475270  0.352352169
 6:           EAT26_dieting -0.0103300828 -0.012375731  0.047705870
 7:           EAT26_bulimia  0.0140996397  0.019151883 -0.020971586
 8:            IAT_salience  0.0555934755  0.690177959  0.098964494
 9:       IAT_excessive_use  0.0243165593  0.870488955 -0.001649978
10:        IAT_neglect_work  0.0227059550  0.743439491 -0.036089406
11:        IAT_anticipation  0.0142404016  0.734170035 -0.005520503
12:        IAT_lack_control  0.0020497057  0.793918378 -0.028125813
13: IAT_neglect_social_life -0.2238293124  0.451825055  0.215941885
14:            OCIR_washing -0.0046050398  0.048154494  0.668111487
15:           OCIR_checking  0.0006717649  0.054097495  0.695339595
16:           OCIR_ordering  0.0013936937 -0.127659074  0.581798053
17:          OCIR_obsessing  0.4840147882  0.023577525  0.377808919
18:           OCIR_hearding  0.2412322604  0.054541106  0.392134214
19:       OCIR_neutralising  0.0486262515  0.044088000  0.649221300
20:               PSS_total  0.7317120327  0.028430266  0.091341620
                         rn           ML2          ML3          ML4
              ML1
            <num>
 1:  0.0287004957
 2: -0.0047253301
 3: -0.0180010452
 4:  0.0065006991
 5:  0.2430813637
 6:  0.7774455707
 7:  0.9922771884
 8: -0.0660321759
 9:  0.0848570355
10:  0.0976548758
11: -0.0915037975
12: -0.0204125548
13: -0.0584342149
14: -0.0366463218
15:  0.0122737649
16:  0.0005558069
17:  0.0499925213
18:  0.0055167590
19:  0.0571161963
20:  0.0421634813
              ML1
colnames(load)[1] <- "Subscale"

loadings.m <- melt(load, id="Subscale",
                   measure=c("ML3", "ML2","ML1", "ML4"),
                   variable.name="Factor", value.name="Loading")

# Name factors
labels <- c(ML3 = "Media", ML1 = "Eat",
            ML2 = "Stress", ML4 = "Comp.")

loadings.m$subscales = fact_col_new

loadings.m$subscales <- factor(loadings.m$subscales, levels = loadings.m$subscales[seq (1:20)])

pp <- ggplot(loadings.m, aes(subscales, abs(Loading), fill=Loading)) +
  facet_wrap(~ Factor, nrow=1, labeller = labeller(Factor = labels) ) +
  geom_bar(stat="identity") + #make the bars
  coord_flip() + #flip the axes so the test names can be horizontal
  scale_fill_gradient2(name = "Loading",
                       high = "#006666", mid = "white", low = "goldenrod4",
                       midpoint=0, guide=F) +
  scale_x_discrete(limits = rev(levels(loadings.m$subscales)))+
  ylab("Loading Strength") +
  theme_bw(base_size=10)

# Make plot nicer
ppp <-   pp + theme_bw(base_size = 10, base_family = "Helvetica")+
  theme(strip.text.x = element_text(size = 15, face = "bold"),
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(),
        strip.background = element_rect(color="white", fill="white", linetype="solid"),
        axis.title.x = element_text(size = 12),
        axis.text.y = element_blank(),
        axis.title.y = element_blank(),
        legend.position = "none")

ppp

dev.print(pdf, file.path(figures_path, "experiment_2_factors_replication.pdf"))
quartz_off_screen 
                2 
dev.off()
null device 
          1 
Factors correlations
var.net = c("COHS_automaticity", "COHS_routine", "UPPS_total" )
db.network.tmp2 <- experiment_2_items[var.net]

# Merge with full database
axes.exp2 <- s.exp2$scores

# Combine
db.network.exp2 <- cbind(db.network.tmp2, axes.exp2)

# Rename with interpreted factors
old_names = c("COHS_automaticity", "COHS_routine","UPPS_total",
               "ML2", "ML3","ML4", "ML1")

new_names <- c("Automaticity","Routine","Impuls.",
               "Stress", "Media", "Comp.", "Eat")
 
colors <- c(pal[8], pal[8],pal[8],
            pal[9], pal[9], pal[9],
            pal[9])

colnames(db.network.exp2)[colnames(db.network.exp2) == old_names] <- new_names

# Descriptive correlation
factor_corr_plot <- cpplus(db.network.exp2, reorder=FALSE, alpha=0.05)

 0 missing correlations set to zero

dev.print(pdf, file.path(figures_path, "experiment_2_factors_correlation_replication.pdf"))
quartz_off_screen 
                2 
dev.off()
null device 
          1 

Dynamic network analysis

Centrality table:

# Estimate network
mynetwork.exp2 <- estimateNetwork(db.network.exp2, default ="EBICglasso") # Lasso with ebic hyperparameter is 0.5

CentralityTable <- centralityTable(mynetwork.exp2)

EITable <- subset(CentralityTable, measure == "ExpectedInfluence")

table_exp2_ei <- knitr::kable(EITable , "html", caption = "Centrality Table Experiment 2") %>%
 kableExtra::kable_styling(latex_options = "HOLD_position", position = "center", full_width = F) %>%
  row_spec(0,bold=T,align='c')

table_exp2_ei
Centrality Table Experiment 2
graph type node measure value
22 graph 1 NA Automaticity ExpectedInfluence 0.9616973
23 graph 1 NA Routine ExpectedInfluence -1.4763777
24 graph 1 NA Impuls. ExpectedInfluence -0.4931808
25 graph 1 NA Stress ExpectedInfluence 1.3695831
26 graph 1 NA Media ExpectedInfluence 0.4306671
27 graph 1 NA Comp. ExpectedInfluence -0.0240064
28 graph 1 NA Eat ExpectedInfluence -0.7683826
nledges <- getWmat(mynetwork.exp2)

plot_network.exp2 <- qgraph(nledges,
       layout = "spring",
       labels = new_names,
       label.scale = F,
       label.cex = 1,
       edge.labels = F,
       #cut = 0.1,
       color = colors,
       border.color = colors,
       border.width = 4,
       node.width = 0.9,
       posCol = c("#006666","#006666"),
       negCol = c("goldenrod4","goldenrod4"),
       vTrans = 150,
       label.font = 2
       )

dev.print(pdf, file.path(figures_path, "experiment_2_network_replication.pdf"))
quartz_off_screen 
                2 
print(plot_network.exp2)
From        To  Weight
1    ---     2   0.25 
1    ---     3   0.26 
2    ---     3   -0.12 
1    ---     4   0 
2    ---     4   0.07 
3    ---     4   0.15 
1    ---     5   0.19 
3    ---     5   0.14 
4    ---     5   0.26 
2    ---     6   0.15 
3    ---     6   0.08 
4    ---     6   0.22 
5    ---     6   0.17 
1    ---     7   0.16 
3    ---     7   0.04 
4    ---     7   0.26 
6    ---     7   0.04 
NULL
dev.off()
null device 
          1 
Estimate the network stability

First for edges:

# Set seed to obtain reproducible results
set.seed(1331)
b1 <- bootnet(mynetwork.exp2, nBoots= 10000, nCores = 1,
              statistics = c("strength","expectedInfluence","edge"),caseN = 50)

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |                                                                      |   1%
  |                                                                            
  |=                                                                     |   1%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |==                                                                    |   4%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=======                                                               |  11%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |=========                                                             |  14%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |============                                                          |  16%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |============                                                          |  18%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |================                                                      |  24%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |=================                                                     |  25%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |===================                                                   |  26%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |===================                                                   |  28%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  29%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=======================                                               |  34%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |==========================                                            |  36%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |============================                                          |  39%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |============================                                          |  41%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |==============================                                        |  44%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |=================================                                     |  46%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |=================================                                     |  48%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |===================================                                   |  49%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |===================================                                   |  51%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=====================================                                 |  54%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  56%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |==========================================                            |  59%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |==========================================                            |  61%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |============================================                          |  64%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |===============================================                       |  66%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |=================================================                     |  71%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |===================================================                   |  74%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=====================================================                 |  75%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  76%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |==========================================================            |  84%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  86%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |===============================================================       |  89%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |====================================================================  |  96%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |===================================================================== |  99%
  |                                                                            
  |======================================================================|  99%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |                                                                      |   1%
  |                                                                            
  |=                                                                     |   1%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |==                                                                    |   4%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=======                                                               |  11%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |=========                                                             |  14%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |============                                                          |  16%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |============                                                          |  18%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |================                                                      |  24%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |=================                                                     |  25%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |===================                                                   |  26%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |===================                                                   |  28%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  29%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=======================                                               |  34%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |==========================                                            |  36%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |============================                                          |  39%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |============================                                          |  41%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |==============================                                        |  44%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |=================================                                     |  46%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |=================================                                     |  48%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |===================================                                   |  49%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |===================================                                   |  51%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=====================================                                 |  54%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  56%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |==========================================                            |  59%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |==========================================                            |  61%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |============================================                          |  64%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |===============================================                       |  66%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |=================================================                     |  71%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |===================================================                   |  74%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=====================================================                 |  75%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  76%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |==========================================================            |  84%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  86%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |===============================================================       |  89%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |====================================================================  |  96%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |===================================================================== |  99%
  |                                                                            
  |======================================================================|  99%
  |                                                                            
  |======================================================================| 100%
tb.b1 = summary(b1)

table_exp2_boot <- knitr::kable(tb.b1 , "html", caption = "Table Experiment 2") %>%
 kableExtra::kable_styling(latex_options = "HOLD_position", position = "center", full_width = F) %>%
  row_spec(0,bold=T,align='c')

table_exp2_boot
Table Experiment 2
type id node1 node2 sample mean sd CIlower CIupper q2.5 q97.5 q2.5_non0 mean_non0 q97.5_non0 var_non0 sd_non0 prop0
edge Automaticity--Comp. Automaticity Comp. 0.0000000 -0.0064830 0.0356246 -0.0712491 0.0712491 -0.1242915 0.0441179 -0.1737906 -0.0315015 0.0761580 0.0053806 0.0733525 0.7942
edge Automaticity--Eat Automaticity Eat 0.1636225 0.1440842 0.0552159 0.0531907 0.2740542 0.0350811 0.2507281 0.0412471 0.1452315 0.2508606 0.0029064 0.0539113 0.0079
edge Automaticity--Impuls. Automaticity Impuls. 0.2621576 0.2448586 0.0591959 0.1437657 0.3805495 0.1304335 0.3601778 0.1305848 0.2448831 0.3601788 0.0034985 0.0591482 0.0001
edge Automaticity--Media Automaticity Media 0.1904930 0.1786615 0.0555534 0.0793863 0.3015997 0.0713059 0.2864654 0.0720021 0.1788403 0.2864713 0.0030573 0.0552927 0.0010
edge Automaticity--Routine Automaticity Routine 0.2527804 0.2288641 0.0637351 0.1253102 0.3802507 0.1045406 0.3538049 0.1053052 0.2290932 0.3538081 0.0040137 0.0633541 0.0010
edge Automaticity--Stress Automaticity Stress 0.0012033 0.0281719 0.0408422 -0.0804811 0.0828876 0.0000000 0.1277034 0.0006149 0.0520160 0.1428117 0.0018397 0.0428914 0.4584
edge Comp.--Eat Comp. Eat 0.0427927 0.0509891 0.0644300 -0.0860673 0.1716526 -0.0426538 0.1975909 -0.0689391 0.0783243 0.2126016 0.0042357 0.0650822 0.3490
edge Impuls.--Comp. Impuls. Comp. 0.0838299 0.0786948 0.0516253 -0.0194207 0.1870805 0.0000000 0.1865229 0.0144699 0.0889308 0.1884184 0.0021015 0.0458419 0.1151
edge Impuls.--Eat Impuls. Eat 0.0445181 0.0521963 0.0503981 -0.0562781 0.1453142 0.0000000 0.1657160 0.0078113 0.0719949 0.1722774 0.0020779 0.0455844 0.2750
edge Impuls.--Media Impuls. Media 0.1397610 0.1369189 0.0558912 0.0279786 0.2515435 0.0249372 0.2453796 0.0331103 0.1383159 0.2457438 0.0029625 0.0544285 0.0101
edge Impuls.--Stress Impuls. Stress 0.1518038 0.1421942 0.0563200 0.0391639 0.2644437 0.0297412 0.2506119 0.0365484 0.1434132 0.2511316 0.0030243 0.0549936 0.0085
edge Media--Comp. Media Comp. 0.1732516 0.1656796 0.0653008 0.0426501 0.3038532 0.0399292 0.2933038 0.0451923 0.1668475 0.2935991 0.0040994 0.0640263 0.0070
edge Media--Eat Media Eat 0.0000000 0.0102056 0.0466151 -0.0932301 0.0932301 -0.1088494 0.1165160 -0.1410799 0.0239175 0.1362211 0.0047651 0.0690300 0.5733
edge Routine--Comp. Routine Comp. 0.1486035 0.1363866 0.0605266 0.0275503 0.2696567 0.0000000 0.2540639 0.0366806 0.1409972 0.2551878 0.0031372 0.0560105 0.0327
edge Routine--Eat Routine Eat 0.0000000 0.0203125 0.0513919 -0.1027838 0.1027838 -0.0961737 0.1336196 -0.1282246 0.0417181 0.1532277 0.0045318 0.0673184 0.5131
edge Routine--Impuls. Routine Impuls. -0.1165011 -0.0864185 0.0772861 -0.2710733 0.0380710 -0.2453830 0.0000000 -0.2594886 -0.1304430 -0.0424491 0.0032730 0.0572098 0.3375
edge Routine--Media Routine Media 0.0000000 0.0080162 0.0297163 -0.0594325 0.0594325 -0.0611048 0.0841458 -0.0979594 0.0274905 0.1080506 0.0024935 0.0499350 0.7084
edge Routine--Stress Routine Stress 0.0747807 0.0560677 0.0472770 -0.0197734 0.1693348 0.0000000 0.1577589 0.0118707 0.0737539 0.1639386 0.0016357 0.0404434 0.2398
edge Stress--Comp. Stress Comp. 0.2153482 0.2108961 0.0528524 0.1096434 0.3210531 0.1063486 0.3124936 0.1066167 0.2109383 0.3124968 0.0027850 0.0527735 0.0002
edge Stress--Eat Stress Eat 0.2570020 0.2338035 0.0574777 0.1420466 0.3719573 0.1177569 0.3449605 0.1177569 0.2338035 0.3449605 0.0033037 0.0574777 0.0000
edge Stress--Media Stress Media 0.2555402 0.2455909 0.0558864 0.1437674 0.3673130 0.1322080 0.3539872 0.1322080 0.2455909 0.3539872 0.0031233 0.0558864 0.0000
strength Automaticity Automaticity 0.8702567 0.8399077 0.1247966 0.6206635 1.1198500 0.6292216 1.1501134 0.6292216 0.8399077 1.1501134 0.0155742 0.1247966 0.0000
strength Comp. Comp. 0.6638260 0.6605836 0.1306798 0.4024665 0.9251855 0.4255566 0.9578522 0.4255566 0.6605836 0.9578522 0.0170772 0.1306798 0.0000
strength Eat Eat 0.5079352 0.5449044 0.1174018 0.2731315 0.7427389 0.3524932 0.8269960 0.3524932 0.5449044 0.8269960 0.0137832 0.1174018 0.0000
strength Impuls. Impuls. 0.7985715 0.7420193 0.1577668 0.4830378 1.1141052 0.4679107 1.0696116 0.4679107 0.7420193 1.0696116 0.0248904 0.1577668 0.0000
strength Media Media 0.7590459 0.7663671 0.1038221 0.5514016 0.9666901 0.5842121 1.0040013 0.5842121 0.7663671 1.0040013 0.0107790 0.1038221 0.0000
strength Routine Routine 0.5926657 0.5550617 0.1884670 0.2157316 0.9695998 0.2378662 0.9572958 0.2385380 0.5552838 0.9573208 0.0354107 0.1881773 0.0004
strength Stress Stress 0.9556781 0.9189438 0.1007311 0.7542158 1.1571404 0.7209229 1.1191838 0.7209229 0.9189438 1.1191838 0.0101468 0.1007311 0.0000
plot (b1, plot = "interval", split0 = TRUE, order="sample", labels=T)

And for centrality indices:

set.seed(1331)
b2 <- bootnet(mynetwork.exp2, nBoots= 10000, nCores = 1, type = "case",
              statistics = c("strength","expectedInfluence","edge"),caseN = 50)

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |                                                                      |   1%
  |                                                                            
  |=                                                                     |   1%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |==                                                                    |   4%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=======                                                               |  11%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |=========                                                             |  14%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |============                                                          |  16%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |============                                                          |  18%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |================                                                      |  24%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |=================                                                     |  25%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |===================                                                   |  26%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |===================                                                   |  28%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  29%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=======================                                               |  34%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |==========================                                            |  36%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |============================                                          |  39%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |============================                                          |  41%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |==============================                                        |  44%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |=================================                                     |  46%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |=================================                                     |  48%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |===================================                                   |  49%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |===================================                                   |  51%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=====================================                                 |  54%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  56%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |==========================================                            |  59%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |==========================================                            |  61%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |============================================                          |  64%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |===============================================                       |  66%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |=================================================                     |  71%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |===================================================                   |  74%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=====================================================                 |  75%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  76%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |==========================================================            |  84%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  86%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |===============================================================       |  89%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |====================================================================  |  96%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |===================================================================== |  99%
  |                                                                            
  |======================================================================|  99%
  |                                                                            
  |======================================================================| 100%

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |                                                                      |   1%
  |                                                                            
  |=                                                                     |   1%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |==                                                                    |   4%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   6%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=======                                                               |  11%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |=========                                                             |  14%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |============                                                          |  16%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |============                                                          |  18%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |================                                                      |  24%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |=================                                                     |  25%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |===================                                                   |  26%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |===================                                                   |  28%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  29%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=======================                                               |  34%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |==========================                                            |  36%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |============================                                          |  39%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |============================                                          |  41%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |==============================                                        |  44%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |=================================                                     |  46%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |=================================                                     |  48%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |===================================                                   |  49%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |===================================                                   |  51%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=====================================                                 |  54%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  56%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |==========================================                            |  59%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |==========================================                            |  61%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |============================================                          |  64%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |===============================================                       |  66%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |=================================================                     |  71%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |===================================================                   |  74%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=====================================================                 |  75%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  76%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |========================================================              |  79%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |==========================================================            |  84%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  86%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |===============================================================       |  89%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |===============================================================       |  91%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |=================================================================     |  94%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |====================================================================  |  96%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |===================================================================== |  99%
  |                                                                            
  |======================================================================|  99%
  |                                                                            
  |======================================================================| 100%
corStability(b2)
=== Correlation Stability Analysis === 

Sampling levels tested:
   nPerson Drop%   n
1       71  75.1 219
2       75  73.7 187
3       79  72.3 199
4       83  70.9 185
5       88  69.1 211
6       92  67.7 220
7       96  66.3 211
8      100  64.9 193
9      104  63.5 212
10     108  62.1 179
11     112  60.7 202
12     116  59.3 223
13     120  57.9 227
14     124  56.5 211
15     128  55.1 194
16     132  53.7 200
17     136  52.3 175
18     140  50.9 218
19     145  49.1 210
20     149  47.7 185
21     153  46.3 208
22     157  44.9 201
23     161  43.5 189
24     165  42.1 169
25     169  40.7 210
26     173  39.3 196
27     177  37.9 207
28     181  36.5 181
29     185  35.1 225
30     189  33.7 189
31     193  32.3 182
32     197  30.9 204
33     202  29.1 222
34     206  27.7 185
35     210  26.3 172
36     214  24.9 214
37     218  23.5 194
38     222  22.1 211
39     226  20.7 200
40     230  19.3 192
41     234  17.9 197
42     238  16.5 165
43     242  15.1 207
44     246  13.7 192
45     250  12.3 210
46     254  10.9 197
47     259   9.1 205
48     263   7.7 202
49     267   6.3 203
50     271   4.9 210

Maximum drop proportions to retain correlation of 0.7 in at least 95% of the samples:

edge: 0.491 
  - For more accuracy, run bootnet(..., caseMin = 0.477, caseMax = 0.509) 

expectedInfluence: 0.491 
  - For more accuracy, run bootnet(..., caseMin = 0.477, caseMax = 0.509) 

strength: 0.351 
  - For more accuracy, run bootnet(..., caseMin = 0.337, caseMax = 0.365) 

Accuracy can also be increased by increasing both 'nBoots' and 'caseN'.
plot (b2, c("expectedInfluence")) # Centrality stability graph

Adding cutoff values to questionnaire distributions

Experiment 1

# Labels
labels <- c(CESD_total = "CES-D", 
            COHS_total = "COHS",
            EAT26_total = "EAT", 
            IAT_total = "IAT", 
            PSS_total = "PSS",
            OCIR_total = "OCI", 
            UPPS_total = "UPPS",
            STAIT_total = "STAI-T",
            PMPUQSV_total = "PMPUQ")

cutoff_values <- tribble(
  ~questionnaire, ~cutoff,
  # CES-D
  # Morin, A. J. S., Moullec, G., Maïano, C., Layet, L., Just, J.-L., & Ninot, 
  # G. (2011). Psychometric properties of the Center for Epidemiologic Studies 
  # Depression Scale (CES-D) in French clinical and nonclinical adults. Revue 
  # d’Épidémiologie et de Santé Publique, 59(5), 327–340.
  # https://doi.org/10.1016/j.respe.2011.03.061
  "CESD_total",   19,

  # EAT
  # Leichner, P., Steiger, H., & Gottheil, N. (1994). Validation d’une échelle
  # d’attitudes alimentaires auprès d’une population québécoise francophone. 
  # 39(1).
  "EAT26_total",  20,
  
  # IAT
  # Khazaal, Y., Billieux, J., Thorens, G., Khan, R., Louati, Y., Scarlatti,
  # E., Theintz, F., Lederrey, J., Van Der Linden, M., & Zullino, D. (2008). 
  # French Validation of the Internet Addiction Test. CyberPsychology & 
  # Behavior, 11(6), 703–706. https://doi.org/10.1089/cpb.2007.0249
  "IAT_total",    50,
  
  # OCI-R
  # Abramowitz, J. S., & Deacon, B. J. (2006). Psychometric properties and 
  # construct validity of the Obsessive–Compulsive Inventory—Revised: 
  # Replication and extension with a clinical sample. Journal of Anxiety 
  # Disorders, 20(8), 1016–1035. https://doi.org/10.1016/j.janxdis.2006.03.001
  "OCIR_total",   14,
  
  # PMPUQ
  # No cutoff score exists
  # Harris, B., Regan, T., Schueler, J., & Fields, S. A. (2020). Problematic 
  # Mobile Phone and Smartphone Use Scales: A Systematic Review. Frontiers in 
  # Psychology, 11. https://doi.org/10.3389/fpsyg.2020.00672
  
  # PSS
  # No cutoff score exists
  # We could use the normative data from the French PSS-10
  
  # STAI
  # Wiglusz, M. S., Landowski, J., & Cubała, W. J. (2019). Psychometric 
  # properties and diagnostic utility of the State–Trait Anxiety Inventory in
  # epilepsy with and without comorbid anxiety disorder. Epilepsy & Behavior, 
  # 92, 221–225. https://doi.org/10.1016/j.yebeh.2019.01.005
  "STAIT_total", 52
  
  # UPPS
  # No cutoff score exists
)

# Plot questionnaire distributions
pp <- ggplot(data = experiment_1_questionnaires, aes (x = score, fill = questionnaire)) +
  facet_wrap(
    ~ questionnaire,
    scales = "free",
    labeller = labeller(questionnaire = labels)
    ) +
  geom_histogram(aes(y=..density..), alpha=0.6) +
  geom_density(aes(color = questionnaire), alpha = 0.3) +
  geom_vline(
    data = cutoff_values, 
    mapping = aes(xintercept = cutoff),
    linetype = "dashed") +
  scale_fill_viridis_d(
    name = "Questionnaires", 
    begin = .1, end = .9,
    option = "inferno",
    aesthetics = c("color", "fill"),
    labels = labels) +
  theme_bw() +
  labs(
    title = "",
    x = "Experiment 1 questionnaires",
    y = "Frequency"
  )

# Plot formatting
ppp_1 <- pp +
  theme_bw(base_size = 10, base_family = "Helvetica") +
  theme(
    strip.text.x = element_text(size = 10),
    panel.grid.major = element_blank(),
    panel.grid.minor = element_blank(),
    strip.background = element_rect(color = "white", fill= "white", linetype = "solid"),
    axis.ticks.x = element_blank(),
    axis.text.x  = element_blank(),
    axis.title.x = element_text(size = 13, margin = margin(103)),
    axis.title.y = element_text(size = 13),
    legend.position = "none"
    # plot.margin = margin(5.5, 5.5, 90, 5.5)
    )

ppp_1
Warning: The dot-dot notation (`..density..`) was deprecated in ggplot2 3.4.0.
ℹ Please use `after_stat(density)` instead.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Experiment 2

Manual coding

# Khazaal, Y., Chatton, A., Rothen, S., Achab, S., Thorens, G., Zullino, D.,
# & Gmel, G. (2016). Psychometric properties of the 7-item game addiction scale 
# among french and German speaking adults. BMC Psychiatry, 16(1), 132. 
# https://doi.org/10.1186/s12888-016-0836-3

# In accordance with the hypothesis of Lemmens et al. [44], those who scored 
# “sometimes” or more on all seven items were defined as monothetic gamers 
# (“pathological gaming”), and those who scored “sometimes” or more on at least 
# half of the items (four to six of seven items) were defined as polythetic 
# gamers (excessive gaming).

gas <- experiment_2_items %>%
  select(starts_with("GAS")) %>%
  mutate(
    excessive_1 = case_when(
      `GAS[1]` >= 3 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    excessive_2 = case_when(
      `GAS[2]` >= 3 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    excessive_3 = case_when(
      `GAS[3]` >= 3 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    excessive_4 = case_when(
      `GAS[4]` >= 3 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    excessive_5 = case_when(
      `GAS[5]` >= 3 ~ 1,
      .default = 0
    )
  ) %>%  
  mutate(
    excessive_6 = case_when(
      `GAS[6]` >= 3 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    excessive_7 = case_when(
      `GAS[7]` >= 3 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    excessive_total = excessive_1 + excessive_2 + excessive_3 + excessive_4 + excessive_5 + excessive_6 + excessive_7
  ) %>%
  mutate(
    excessive = case_when(
      excessive_total >= 4 ~ 1,
      .default = 0
    )
  )

# Get number of excessive gamers
n_excessive <- gas$excessive %>%
  plyr::count() %>%
  filter(x == 1) %>%
  select(freq)
  
# Calculate cutoff that will result in the correct proportion of individuals
# being classified on the plot
cutoff_gas <- sort(gas$GAS_total) %>%
  nth(., (nrow(gas) - as.integer(n_excessive)))
# Hausenblas, H. A., & Downs, D. S. (2002). How Much is Too Much? The 
# Development and Validation of the Exercise Dependence Scale. Psychology & 
# Health, 17(4), 387–404. https://doi.org/10.1080/0887044022000004894

# Individuals who indicate strong endorsement (i.e., 5 or 6 on the Likert scale)
# on at least three of the seven criteria are classified as at-risk.

eds <- experiment_2_items %>%
  select(starts_with("EDSR_")) %>%
  mutate(
    tolerance = case_when(
      EDSR_tolerance >= 15 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    withdrawal = case_when(
      EDSR_withdrawal >= 15 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    lack_control = case_when(
      EDSR_lack_control >= 15 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    time = case_when(
      EDSR_time >= 15 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    reduction_activities = case_when(
      EDSR_reduction_activities >= 15 ~ 1,
      .default = 0
    )
  ) %>%  
  mutate(
    intention = case_when(
      EDSR_intention >= 15 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    continuance = case_when(
      EDSR_continuance >= 15 ~ 1,
      .default = 0
    )
  ) %>%
  mutate(
    at_risk_total = tolerance + withdrawal + lack_control + time + reduction_activities + intention + continuance
  ) %>%
  mutate(
    at_risk = case_when(
      at_risk_total >= 3 ~ 1,
      .default = 0
    )
  )

# Get number of individuals at risk for exercise dependence
n_at_risk <- eds$at_risk %>%
  plyr::count() %>%
  filter(x == 1) %>%
  select(freq)
  
# Calculate cutoff that will result in the correct proportion of individuals
# being classified on the plot
cutoff_eds <- sort(eds$EDSR_total) %>%
  nth(., (nrow(eds) - as.integer(n_at_risk)))
# Brunault, P., Berthoz, S., Gearhardt, A. N., Gierski, F., Kaladjian, A., 
# Bertin, E., Tchernof, A., Biertho, L., De Luca, A., Hankard, R., Courtois, 
# R., Ballon, N., Benzerouk, F., & Bégin, C. (2020). The Modified Yale Food 
# Addiction Scale 2.0: Validation Among Non-Clinical and Clinical 
# French-Speaking Samples and Comparison With the Full Yale Food Addiction 
# Scale 2.0. Frontiers in Psychiatry, 11, 480671. 
# https://doi.org/10.3389/fpsyt.2020.480671
# https://sites.lsa.umich.edu/fastlab/yale-food-addiction-scale/

# Mild Food Addiction = 2 or 3 symptoms and clinical significance
yfas <- experiment_2_items %>%
  select(starts_with("YFAS")) %>%
  mutate(
    addiction = case_when(
      YFAS_score >= 2 & YFAS_clinical_sign == 1 ~ 1,
      .default = 0
    )
  )

# Get number of excessive gamers
n_addiction <- yfas$addiction %>%
  plyr::count() %>%
  filter(x == 1) %>%
  select(freq)
  
# Calculate cutoff that will result in the correct proportion of individuals
# being classified on the plot
cutoff_yfas <- sort(yfas$YFAS_score) %>%
  nth(., (nrow(eds) - as.integer(n_addiction)))
# Labels
labels <- c(EAT26_total = "EAT", 
            COHS_total = "COHS",
            PSS_total = "PSS",
            IAT_total = "IAT", 
            PCLS_total = "PCLS", 
            OCIR_total = "OCI", 
            STICSAT_total = "STICSA-T",
            UPPS_total = "UPPS",
            SASSV_total ="SASSV" ,
            GAS_total = "GAS",
            EDSR_total = "EDS",
            LSAS_total = "LSAS",
            YFAS_score = "mYFAS",
            QABB_total = "QABB",
            CESD_total = "CES-D")

cutoff_values <- tribble(
  ~questionnaire, ~cutoff,
  # CES-D
  # Morin, A. J. S., Moullec, G., Maïano, C., Layet, L., Just, J.-L., & Ninot, 
  # G. (2011). Psychometric properties of the Center for Epidemiologic Studies 
  # Depression Scale (CES-D) in French clinical and nonclinical adults. Revue 
  # d’Épidémiologie et de Santé Publique, 59(5), 327–340.
  # https://doi.org/10.1016/j.respe.2011.03.061
  "CESD_total",   19,

  # EAT
  # Leichner, P., Steiger, H., & Gottheil, N. (1994). Validation d’une échelle
  # d’attitudes alimentaires auprès d’une population québécoise francophone. 
  # 39(1).
  "EAT26_total",  20,
  
  # IAT
  # Khazaal, Y., Billieux, J., Thorens, G., Khan, R., Louati, Y., Scarlatti,
  # E., Theintz, F., Lederrey, J., Van Der Linden, M., & Zullino, D. (2008). 
  # French Validation of the Internet Addiction Test. CyberPsychology & 
  # Behavior, 11(6), 703–706. https://doi.org/10.1089/cpb.2007.0249
  "IAT_total",    50,
  
  # OCI-R
  # Abramowitz, J. S., & Deacon, B. J. (2006). Psychometric properties and 
  # construct validity of the Obsessive–Compulsive Inventory—Revised: 
  # Replication and extension with a clinical sample. Journal of Anxiety 
  # Disorders, 20(8), 1016–1035. https://doi.org/10.1016/j.janxdis.2006.03.001
  "OCIR_total",   14,
  
  # PMPUQ
  # No cutoff score exists
  # Harris, B., Regan, T., Schueler, J., & Fields, S. A. (2020). Problematic 
  # Mobile Phone and Smartphone Use Scales: A Systematic Review. Frontiers in 
  # Psychology, 11. https://doi.org/10.3389/fpsyg.2020.00672
  
  # PSS
  # No cutoff score exists
  # We could use the normative data from the French PSS-10
  
  # UPPS
  # No cutoff score exists
  
  # EDS-R
  # No cutoff score, but calculation to determine if at-risk of dependence
  "EDSR_total", cutoff_eds,
  
  # GAS
  # No cutoff score, but calculation to determine if excessive above
  "GAS_total", cutoff_gas,

  # LSAS
  # Caballo, V. E., Salazar, I. C., Arias, V., Hofmann, S. G., & Curtiss, J. 
  # (2018). Psychometric properties of the Liebowitz Social Anxiety Scale in a 
  # large cross-cultural Spanish and Portuguese speaking sample. Brazilian 
  # Journal of Psychiatry, 41, 122–130. 
  # https://doi.org/10.1590/1516-4446-2018-0006
  "LSAS_total", 60,
  
  # PCLS
  # Blanchard, E. B., Jones-Alexander, J., Buckley, T. C., & Forneris, 
  # C. A. (1996). Psychometric properties of the PTSD checklist (PCL). Behaviour
  # Research and Therapy, 34(8), 669–673.
  # https://doi.org/10.1016/0005-7967(96)00033-2
  "PCLS_total", 44,
  
  # QABB
  # Lejoyeux, M., Mathieu, K., Embouazza, H., Huet, F., & Lequen, V. (2007). 
  # Prevalence of compulsive buying among customers of a Parisian general store.
  # Comprehensive Psychiatry, 48(1), 42–46. 
  # https://doi.org/10.1016/j.comppsych.2006.05.005
  "QABB_total", 10,
  
  # SASSV
  # Lopez-Fernandez, O. (2017). Short version of the Smartphone Addiction Scale 
  # adapted to Spanish and French: Towards a cross-cultural research in 
  # problematic mobile phone use. Addictive Behaviors, 64, 275–280. 
  # https://doi.org/10.1016/j.addbeh.2015.11.013
  "SASSV_total", 32,
  
  # STICSA-T
  # Van Dam, N. T., Gros, D. F., Earleywine, M., & Antony, M. M. (2013). 
  # Establishing a trait anxiety threshold that signals likelihood of anxiety 
  # disorders. Anxiety, Stress, & Coping, 26(1), 70–86. 
  # https://doi.org/10.1080/10615806.2011.631525
  "STICSAT_total", 43,
  
  # YFAS
  # No cutoff score, but calculation to determine if addiction present above
  "YFAS_score", cutoff_yfas
)

# Plot questionnaire distributions
pp <- ggplot(data = experiment_2_questionnaires, aes (x = score, fill = questionnaire)) +
  facet_wrap(
    ~ questionnaire,
    scales = "free",
    labeller = labeller(questionnaire = labels)
    ) +
  geom_histogram(aes(y=..density..), alpha=0.6) +
  geom_density(aes(color = questionnaire), alpha = 0.3) +
  geom_vline(
    data = cutoff_values, 
    mapping = aes(xintercept = cutoff),
    linetype = "dashed") +
  scale_fill_viridis_d(
    name = "Questionnaires", 
    begin = .1, end = .9,
    option = "inferno",
    aesthetics = c("color", "fill"),
    labels = labels) +
  theme_bw() +
  labs(
    title = "",
    x = "Experiment 2 questionnaires",
    y = ""
  )

# Plot formatting
ppp_2 <- pp + 
  theme_bw(base_size = 10, base_family = "Helvetica") +
  theme(
    strip.text.x = element_text(size = 10),
    panel.grid.major = element_blank(),
    panel.grid.minor = element_blank(),
    strip.background = element_rect(color = "white", fill = "white", linetype = "solid"),
    axis.ticks.x = element_blank(),
    axis.text.x  = element_blank(),
    axis.title.x = element_text(size = 13),
    axis.title.y = element_text(size = 13),
    legend.position = "none"
    )

ppp_2
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Create joint figure

p <- ggarrange(
  ppp_1, ppp_2, labels = c("A", "B"),
  widths = c(1, 1.3)
  )
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
ggsave(
  filename = str_c(
    figures_path, "/questionnaires_distribution_revision.pdf"),
  plot = p,
  height = 6,
  width = 11)

Create joint figure of COHS subscales

experiment_1_cohs <- readRDS(str_c(results_path, "/experiment_1_cohs.rds"))
experiment_2_cohs <- readRDS(str_c(results_path, "/experiment_2_cohs.rds"))

labels <- c(routine = "COHS Routine",
            automaticity = "COHS Automaticity",
            total = "COHS Total")

# Plot Experiment 1
pp_1 = ggplot(data = experiment_1_cohs, aes (x = value, fill = scale)) +
  facet_wrap(~scale, scales = "free", labeller = labeller(scale = labels)) +
  geom_histogram(aes(y=..density..),alpha=0.6) +
  geom_density(aes(color = scale), alpha = 0.3) +
    scale_fill_viridis_d(name = "Questionnaires", 
                       begin = .1, end = .9,
                       option = "inferno",
                       aesthetics = c("color", "fill"),
                       labels = labels)+
  theme_bw()+
  labs(
    title = '',
    x = "Experiment 1",
    y = "Frequency"
  )

# Make plot nicer
ppp_1 <-   pp_1 + theme_bw(base_size = 10, base_family = "Helvetica")+
  theme(strip.text.x = element_text(size = 10, face = "bold"),
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(),
        strip.background = element_rect(color="white", fill="white", linetype="solid"),
        axis.title.x = element_text(size = 15, face = "bold"),
        axis.title.y = element_text(size = 15, face = "bold"),
        legend.position = "none")

# Plot Experiment 2
pp_2 = ggplot(data = experiment_2_cohs, aes (x = value, fill = scale)) +
  facet_wrap(~scale, scales = "free", labeller = labeller(scale = labels)) +
  geom_histogram(aes(y=..density..),alpha=0.6) +
  geom_density(aes(color = scale), alpha = 0.3) +
    scale_fill_viridis_d(name = "Questionnaires", 
                       begin = .1, end = .9,
                       option = "inferno",
                       aesthetics = c("color", "fill"),
                       labels = labels)+
  theme_bw()+
  labs(
    title = '',
    x = "Experiment 2",
    y = "Frequency"
  )

# Make plot nicer
ppp_2 <-   pp_2 + theme_bw(base_size = 10, base_family = "Helvetica")+
  theme(strip.text.x = element_text(size = 10, face = "bold"),
        panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(),
        strip.background = element_rect(color="white", fill="white", linetype="solid"),
        # axis.ticks.x = element_blank(),
        # axis.text.x  = element_blank(),
        axis.title.x = element_text(size = 15, face = "bold"),
        axis.title.y = element_text(size = 15, face = "bold"),
        legend.position = "none")

# Create joint figure
p <- ggarrange(
  ppp_1, ppp_2, labels = c("A", "B"), align = "v",
  nrow = 2,
  widths = c(1, 1.3)
  )
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
p

ggsave(
  filename = str_c(
    figures_path, "/cohs_distribution_revision.pdf"),
  plot = p,
  height = 6,
  width = 11)